home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-15 / drystn.zip / DHRYSTON.C < prev    next >
Text File  |  1993-01-04  |  28KB  |  772 lines

  1. /*    EVERBODY:    Please read "APOLOGY" below. -rick 01/06/85
  2.  *            See introduction in net.arch, or net.micro
  3.  *
  4.  *    "DHRYSTONE" Benchmark Program
  5.  *
  6.  *    Version:    C/1.1, 12/01/84
  7.  *
  8.  *    Date:        PROGRAM updated 01/06/86, RESULTS updated 03/31/86
  9.  *
  10.  *    Author:        Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013
  11.  *            Translated from ADA by Rick Richardson
  12.  *            Every method to preserve ADA-likeness has been used,
  13.  *            at the expense of C-ness.
  14.  *
  15.  *    Compile:    cc -O dry.c -o drynr            : No registers
  16.  *            cc -O -DREG=register dry.c -o dryr    : Registers
  17.  *
  18.  *    Defines:    Defines are provided for old C compiler's
  19.  *            which don't have enums, and can't assign structures.
  20.  *            The time(2) function is library dependant; Most
  21.  *            return the time in seconds, but beware of some, like
  22.  *            Aztec C, which return other units.
  23.  *            The LOOPS define is initially set for 50000 loops.
  24.  *            If you have a machine with large integers and is
  25.  *            very fast, please change this number to 500000 to
  26.  *            get better accuracy.  Please select the way to
  27.  *            measure the execution time using the TIME define.
  28.  *            For single user machines, time(2) is adequate. For
  29.  *            multi-user machines where you cannot get single-user
  30.  *            access, use the times(2) function.  If you have
  31.  *            neither, use a stopwatch in the dead of night.
  32.  *            Use a "printf" at the point marked "start timer"
  33.  *            to begin your timings. DO NOT use the UNIX "time(1)"
  34.  *            command, as this will measure the total time to
  35.  *            run this program, which will (erroneously) include
  36.  *            the time to malloc(3) storage and to compute the
  37.  *            time it takes to do nothing.
  38.  *
  39.  *    Run:        drynr; dryr
  40.  *
  41.  *    Results:    If you get any new machine/OS results, please send to:
  42.  *
  43.  *                ihnp4!castor!pcrat!rick
  44.  *
  45.  *            and thanks to all that do.  Space prevents listing
  46.  *            the names of those who have provided some of these
  47.  *            results.  I'll be forwarding these results to
  48.  *            Rheinhold Weicker.
  49.  *
  50.  *    Note:        I order the list in increasing performance of the
  51.  *            "with registers" benchmark.  If the compiler doesn't
  52.  *            provide register variables, then the benchmark
  53.  *            is the same for both REG and NOREG.
  54.  *
  55.  *    PLEASE:        Send complete information about the machine type,
  56.  *            clock speed, OS and C manufacturer/version.  If
  57.  *            the machine is modified, tell me what was done.
  58.  *            On UNIX, execute uname -a and cc -V to get this info.
  59.  *
  60.  *    80x8x NOTE:    80x8x benchers: please try to do all memory models
  61.  *            for a particular compiler.
  62.  *
  63.  *    APOLOGY (1/30/86):
  64.  *        Well, I goofed things up!  As pointed out by Haakon Bugge,
  65.  *        the line of code marked "GOOF" below was missing from the
  66.  *        Dhrystone distribution for the last several months.  It
  67.  *        *WAS* in a backup copy I made last winter, so no doubt it
  68.  *        was victimized by sleepy fingers operating vi!
  69.  *
  70.  *        The effect of the line missing is that the reported benchmarks
  71.  *        are 15% too fast (at least on a 80286).  Now, this creates
  72.  *        a dilema - do I throw out ALL the data so far collected
  73.  *        and use only results from this (corrected) version, or
  74.  *        do I just keep collecting data for the old version?
  75.  *
  76.  *        Since the data collected so far *is* valid as long as it
  77.  *        is compared with like data, I have decided to keep
  78.  *        TWO lists- one for the old benchmark, and one for the
  79.  *        new.  This also gives me an opportunity to correct one
  80.  *        other error I made in the instructions for this benchmark.
  81.  *        My experience with C compilers has been mostly with
  82.  *        UNIX 'pcc' derived compilers, where the 'optimizer' simply
  83.  *        fixes sloppy code generation (peephole optimization).
  84.  *        But today, there exist C compiler optimizers that will actually
  85.  *        perform optimization in the Computer Science sense of the word,
  86.  *        by removing, for example, assignments to a variable whose
  87.  *        value is never used.  Dhrystone, unfortunately, provides
  88.  *        lots of opportunities for this sort of optimization.
  89.  *
  90.  *        I request that benchmarkers re-run this new, corrected
  91.  *        version of Dhrystone, turning off or bypassing optimizers
  92.  *        which perform more than peephole optimization.  Please
  93.  *        indicate the version of Dhrystone used when reporting the
  94.  *        results to me.
  95.  *        
  96.  * RESULTS BEGIN HERE
  97.  *
  98.  *----------------DHRYSTONE VERSION 1.1 RESULTS BEGIN--------------------------
  99.  *
  100.  * MACHINE    MICROPROCESSOR    OPERATING    COMPILER    DHRYSTONES/SEC.
  101.  * TYPE                SYSTEM                NO REG    REGS
  102.  * --------------------------    ------------    -----------    ---------------
  103.  * Apple IIe    65C02-1.02Mhz    DOS 3.3        Aztec CII v1.05i  37      37
  104.  * -        Z80-2.5Mhz    CPM-80 v2.2    Aztec CII v1.05g  91      91
  105.  * -        8086-8Mhz    RMX86 V6    Intel C-86 V2.0     197     203LM??
  106.  * IBM PC/XT    8088-4.77Mhz    COHERENT 2.3.43    Mark Wiiliams     259     275
  107.  * -        8086-8Mhz    RMX86 V6    Intel C-86 V2.0     287     304 ??
  108.  * Fortune 32:16 68000-6Mhz    V7+sys3+4.1BSD  cc         360     346
  109.  * PDP-11/34A    w/FP-11C    UNIX V7m    cc         406     449
  110.  * Macintosh512    68000-7.7Mhz    Mac ROM O/S    DeSmet(C ware)     625     625
  111.  * VAX-11/750    w/FPA        UNIX 4.2BSD    cc         831     852
  112.  * DataMedia 932 68000-10Mhz    UNIX sysV    cc         837     888
  113.  * Plexus P35    68000-12.5Mhz    UNIX sysIII    cc         835     894
  114.  * ATT PC7300    68010-10Mhz    UNIX 5.0.3    cc         973    1034
  115.  * Compaq II    80286-8Mhz    MSDOS 3.1    MS C 3.0     1086    1140 LM
  116.  * IBM PC/AT    80286-7.5Mhz    Venix/286 SVR2  cc              1159    1254 *15
  117.  * Compaq II    80286-8Mhz    MSDOS 3.1    MS C 3.0     1190    1282 MM
  118.  * MicroVAX II    -        Mach/4.3    cc        1361    1385
  119.  * DEC uVAX II    -        Ultrix-32m v1.1    cc        1385    1399
  120.  * Compaq II    80286-8Mhz    MSDOS 3.1    MS C 3.0     1351    1428
  121.  * VAX 11/780    -        UNIX 4.2BSD    cc        1417    1441
  122.  * VAX-780/MA780        Mach/4.3    cc        1428    1470
  123.  * VAX 11/780    -        UNIX 5.0.1    cc 4.1.1.31    1650    1640
  124.  * Ridge 32C V1    -        ROS 3.3        Ridge C (older)    1628    1695
  125.  * Gould PN6005    -        UTX 1.1c+ (4.2)    cc        1732    1884
  126.  * Gould PN9080    custom ECL    UTX-32 1.1C    cc        4745    4992
  127.  * VAX-784    -        Mach/4.3    cc        5263    5555 &4
  128.  * VAX 8600    -        4.3 BSD        cc        6329    6423
  129.  * Amdahl 5860    -        UTS sysV    cc 1.22           28735   28846
  130.  * IBM3090/200    -        ?        ?           31250   31250
  131.  *
  132.  *
  133.  *----------------DHRYSTONE VERSION 1.0 RESULTS BEGIN--------------------------
  134.  *
  135.  * MACHINE    MICROPROCESSOR    OPERATING    COMPILER    DHRYSTONES/SEC.
  136.  * TYPE                SYSTEM                NO REG    REGS
  137.  * --------------------------    ------------    -----------    ---------------
  138.  * Commodore 64    6510-1MHz    C64 ROM        C Power 2.8      36      36
  139.  * HP-110    8086-5.33Mhz    MSDOS 2.11    Lattice 2.14     284     284
  140.  * IBM PC/XT    8088-4.77Mhz    PC/IX        cc         271     294
  141.  * CCC 3205    -        Xelos(SVR2)     cc         558     592
  142.  * Perq-II    2901 bitslice    Accent S5c     cc (CMU)     301     301
  143.  * IBM PC/XT    8088-4.77Mhz    COHERENT 2.3.43    MarkWilliams cc  296     317
  144.  * Cosmos    68000-8Mhz    UniSoft        cc         305     322
  145.  * IBM PC/XT    8088-4.77Mhz    Venix/86 2.0    cc         297     324
  146.  * DEC PRO 350  11/23           Venix/PRO SVR2  cc               299     325
  147.  * IBM PC    8088-4.77Mhz    MSDOS 2.0    b16cc 2.0     310     340
  148.  * PDP11/23    11/23           Venix (V7)      cc               320     358
  149.  * Commodore Amiga        ?        Lattice 3.02     368     371
  150.  * PC/XT        8088-4.77Mhz    Venix/86 SYS V  cc               339     377
  151.  * IBM PC    8088-4.77Mhz    MSDOS 2.0    CI-C86 2.20M     390     390
  152.  * IBM PC/XT    8088-4.77Mhz    PCDOS 2.1    Wizard 2.1     367     403
  153.  * IBM PC/XT    8088-4.77Mhz    PCDOS 3.1    Lattice 2.15     403     403 @
  154.  * Colex DM-6    68010-8Mhz    Unisoft SYSV    cc         378     410
  155.  * IBM PC    8088-4.77Mhz    PCDOS 3.1    Datalight 1.10     416     416
  156.  * IBM PC    NEC V20-4.77Mhz    MSDOS 3.1    MS 3.1          387     420
  157.  * IBM PC/XT    8088-4.77Mhz    PCDOS 2.1    Microsoft 3.0     390     427
  158.  * IBM PC    NEC V20-4.77Mhz    MSDOS 3.1    MS 3.1 (186)      393     427
  159.  * PDP-11/34    -        UNIX V7M    cc         387     438
  160.  * IBM PC    8088, 4.77mhz    PC-DOS 2.1    Aztec C v3.2d     423     454
  161.  * Tandy 1000    V20, 4.77mhz    MS-DOS 2.11    Aztec C v3.2d     423     458
  162.  * Tandy TRS-16B 68000-6Mhz    Xenix 1.3.5    cc         438     458
  163.  * PDP-11/34    -        RSTS/E        decus c         438     495
  164.  * Onyx C8002    Z8000-4Mhz    IS/1 1.1 (V7)    cc         476     511
  165.  * Tandy TRS-16B 68000-6Mhz    Xenix 1.3.5    Green Hills     609     617
  166.  * DEC PRO 380  11/73           Venix/PRO SVR2  cc               577     628
  167.  * FHL QT+    68000-10Mhz    Os9/68000    version 1.3     603     649 FH
  168.  * Apollo DN550    68010-?Mhz    AegisSR9/IX    cc 3.12         666     666
  169.  * HP-110    8086-5.33Mhz    MSDOS 2.11    Aztec-C         641     676
  170.  * ATT PC6300    8086-8Mhz    MSDOS 2.11    b16cc 2.0     632     684
  171.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    CI-C86 2.1     666     684
  172.  * Tandy 6000    68000-8Mhz    Xenix 3.0    cc         694     694
  173.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc         684     704 MM
  174.  * Macintosh    68000-7.8Mhz 2M    Mac Rom        Mac C 32 bit int 694     704
  175.  * Macintosh    68000-7.7Mhz    -        MegaMax C 2.0     661     709
  176.  * Macintosh512    68000-7.7Mhz    Mac ROM O/S    DeSmet(C ware)     714     714
  177.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc         704     714 LM
  178.  * Codata 3300    68000-8Mhz    UniPlus+ (v7)    cc         678     725
  179.  * WICAT MB    68000-8Mhz    System V    WICAT C 4.1     585     731 ~
  180.  * Cadmus 9000    68010-10Mhz    UNIX        cc         714     735
  181.  * AT&T 6300    8086-8Mhz       Venix/86 SVR2   cc               668     743
  182.  * Cadmus 9790    68010-10Mhz 1MB    SVR0,Cadmus3.7    cc         720     747
  183.  * NEC PC9801F    8086-8Mhz    PCDOS 2.11    Lattice 2.15     768      -  @
  184.  * ATT PC6300    8086-8Mhz    MSDOS 2.11    CI-C86 2.20M     769     769
  185.  * Burroughs XE550 68010-10Mhz    Centix 2.10    cc         769     769 CT1
  186.  * EAGLE/TURBO  8086-8Mhz       Venix/86 SVR2   cc               696     779
  187.  * ALTOS 586    8086-10Mhz    Xenix 3.0b    cc          724     793
  188.  * DEC 11/73    J-11 micro    Ultrix-11 V3.0    cc         735     793
  189.  * ATT 3B2/300    WE32000-?Mhz    UNIX 5.0.2    cc         735     806
  190.  * Apollo DN320    68010-?Mhz    AegisSR9/IX    cc 3.12         806     806
  191.  * IRIS-2400    68010-10Mhz    UNIX System V    cc         772     829
  192.  * Atari 520ST  68000-8Mhz      TOS             DigResearch      839     846
  193.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    MS 3.0(large)     833     847 LM
  194.  * WICAT MB    68000-8Mhz    System V    WICAT C 4.1     675     853 S~
  195.  * VAX 11/750    -        Ultrix 1.1    4.2BSD cc     781     862
  196.  * CCC  7350A    68000-8MHz    UniSoft V.2    cc         821     875
  197.  * VAX 11/750    -        UNIX 4.2bsd    cc         862     877
  198.  * Fast Mac    68000-7.7Mhz    -        MegaMax C 2.0     839     904 +
  199.  * IBM PC/XT    8086-9.54Mhz    PCDOS 3.1    Microsoft 3.0     833     909 C1
  200.  * DEC 11/44            Ultrix-11 V3.0    cc         862     909
  201.  * Macintosh    68000-7.8Mhz 2M    Mac Rom        Mac C 16 bit int 877     909 S
  202.  * CCC 3210    -        Xelos R01(SVR2)    cc         849     924
  203.  * CCC 3220    -               Ed. 7 v2.3      cc         892     925
  204.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc -i         909     925
  205.  * AT&T 6300    8086, 8mhz    MS-DOS 2.11    Aztec C v3.2d     862     943
  206.  * IBM PC/AT    80286-6Mhz    Xenix 3.0    cc         892     961
  207.  * VAX 11/750    w/FPA        Eunice 3.2    cc         914     976
  208.  * IBM PC/XT    8086-9.54Mhz    PCDOS 3.1    Wizard 2.1     892     980 C1
  209.  * IBM PC/XT    8086-9.54Mhz    PCDOS 3.1    Lattice 2.15     980     980 C1
  210.  * Plexus P35    68000-10Mhz    UNIX System III cc         984     980
  211.  * PDP-11/73    KDJ11-AA 15Mhz    UNIX V7M 2.1    cc         862     981
  212.  * VAX 11/750    w/FPA        UNIX 4.3bsd    cc         994     997
  213.  * IRIS-1400    68010-10Mhz    UNIX System V    cc         909    1000
  214.  * IBM PC/AT    80286-6Mhz    Venix/86 2.1    cc         961    1000
  215.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    b16cc 2.0     943    1063
  216.  * Zilog S8000/11 Z8001-5.5Mhz    Zeus 3.2    cc        1011    1084
  217.  * NSC ICM-3216 NSC 32016-10Mhz    UNIX SVR2    cc        1041    1084
  218.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    MS 3.0(small)    1063    1086
  219.  * VAX 11/750    w/FPA        VMS        VAX-11 C 2.0     958    1091
  220.  * Stride    68000-10Mhz    System-V/68    cc        1041    1111
  221.  * Plexus P/60  MC68000-12.5Mhz    UNIX SYSIII    Plexus        1111    1111
  222.  * ATT PC7300    68010-10Mhz    UNIX 5.0.2    cc        1041    1111
  223.  * CCC 3230    -        Xelos R01(SVR2)    cc        1040    1126
  224.  * Stride    68000-12Mhz    System-V/68    cc        1063    1136
  225.  * IBM PC/AT    80286-6Mhz      Venix/286 SVR2  cc              1056    1149
  226.  * Plexus P/60  MC68000-12.5Mhz    UNIX SYSIII    Plexus        1111    1163 T
  227.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    Datalight 1.10    1190    1190
  228.  * ATT PC6300+    80286-6Mhz    MSDOS 3.1    b16cc 2.0    1111    1219
  229.  * IBM PC/AT    80286-6Mhz    PCDOS 3.1    Wizard 2.1    1136    1219
  230.  * Sun2/120    68010-10Mhz    Sun 4.2BSD    cc        1136    1219
  231.  * IBM PC/AT    80286-6Mhz    PCDOS 3.0    CI-C86 2.20M    1219    1219
  232.  * WICAT PB    68000-8Mhz    System V    WICAT C 4.1     998    1226 ~
  233.  * MASSCOMP 500    68010-10MHz    RTU V3.0    cc (V3.2)    1156    1238
  234.  * Alliant FX/8 IP (68012-12Mhz) Concentrix    cc -ip;exec -i     1170    1243 FX
  235.  * Cyb DataMate    68010-12.5Mhz    Uniplus 5.0    Unisoft cc    1162    1250
  236.  * PDP 11/70    -        UNIX 5.2    cc        1162    1250
  237.  * IBM PC/AT    80286-6Mhz    PCDOS 3.1    Lattice 2.15    1250    1250
  238.  * IBM PC/AT    80286-7.5Mhz    Venix/86 2.1    cc        1190    1315 *15
  239.  * Sun2/120    68010-10Mhz    Standalone    cc        1219    1315
  240.  * Intel 380    80286-8Mhz    Xenix R3.0up1    cc        1250    1315 *16
  241.  * Sequent Balance 8000    NS32032-10MHz    Dynix 2.0    cc    1250    1315 N12
  242.  * IBM PC/DSI-32 32032-10Mhz    MSDOS 3.1    GreenHills 2.14    1282    1315 C3
  243.  * ATT 3B2/400    WE32100-?Mhz    UNIX 5.2    cc        1315    1315
  244.  * CCC 3250XP    -        Xelos R01(SVR2)    cc        1215    1318
  245.  * IBM PC/RT 032 RISC(801?)?Mhz BSD 4.2         cc              1248    1333 RT
  246.  * DG MV4000    -        AOS/VS 5.00    cc        1333    1333
  247.  * IBM PC/AT    80286-8Mhz    Venix/86 2.1    cc        1275    1380 *16
  248.  * IBM PC/AT    80286-6Mhz    MSDOS 3.0    Microsoft 3.0    1250    1388
  249.  * ATT PC6300+    80286-6Mhz    MSDOS 3.1    CI-C86 2.20M    1428    1428
  250.  * COMPAQ/286   80286-8Mhz      Venix/286 SVR2  cc              1326    1443
  251.  * IBM PC/AT    80286-7.5Mhz    Venix/286 SVR2  cc              1333    1449 *15
  252.  * WICAT PB    68000-8Mhz    System V    WICAT C 4.1    1169    1464 S~
  253.  * Tandy II/6000 68000-8Mhz    Xenix 3.0    cc          1384    1477
  254.  * MicroVAX II    -        Mach/4.3    cc        1513    1536
  255.  * WICAT MB    68000-12.5Mhz    System V    WICAT C 4.1    1246    1537 ~
  256.  * IBM PC/AT    80286-9Mhz      SCO Xenix V     cc              1540    1556 *18
  257.  * Cyb DataMate    68010-12.5Mhz    Uniplus 5.0    Unisoft cc    1470    1562 S
  258.  * VAX 11/780    -        UNIX 5.2    cc        1515    1562
  259.  * MicroVAX-II    -        -        -        1562    1612
  260.  * VAX-780/MA780        Mach/4.3    cc        1587    1612
  261.  * VAX 11/780    -        UNIX 4.3bsd    cc        1646    1662
  262.  * Apollo DN660    -        AegisSR9/IX    cc 3.12        1666    1666
  263.  * ATT 3B20    -        UNIX 5.2    cc        1515    1724
  264.  * NEC PC-98XA    80286-8Mhz    PCDOS 3.1    Lattice 2.15    1724    1724 @
  265.  * HP9000-500    B series CPU    HP-UX 4.02    cc        1724    -
  266.  * Ridge 32C V1    -        ROS 3.3        Ridge C (older)    1776    -
  267.  * IBM PC/STD    80286-8Mhz    MSDOS 3.0     Microsoft 3.0    1724    1785 C2
  268.  * WICAT MB    68000-12.5Mhz    System V    WICAT C 4.1    1450    1814 S~
  269.  * WICAT PB    68000-12.5Mhz    System V    WICAT C 4.1    1530    1898 ~
  270.  * DEC-2065    KL10-Model B    TOPS-20 6.1FT5    Port. C Comp.    1937    1946
  271.  * Gould PN6005    -        UTX 1.1(4.2BSD)    cc        1675    1964
  272.  * DEC2060    KL-10        TOPS-20        cc        2000    2000 NM
  273.  * Intel 310AP    80286-8Mhz    Xenix 3.0    cc        1893    2009
  274.  * VAX 11/785    -        UNIX 5.2    cc        2083    2083
  275.  * VAX 11/785    -        VMS        VAX-11 C 2.0    2083    2083
  276.  * VAX 11/785    -        UNIX SVR2    cc        2123    2083
  277.  * VAX 11/785   -               ULTRIX-32 1.1   cc        2083    2091
  278.  * VAX 11/785    -        UNIX 4.3bsd    cc        2135    2136
  279.  * WICAT PB    68000-12.5Mhz    System V    WICAT C 4.1    1780    2233 S~
  280.  * Pyramid 90x    -        OSx 2.3        cc        2272    2272
  281.  * Pyramid 90x    FPA,cache,4Mb    OSx 2.5        cc no -O    2777    2777
  282.  * Pyramid 90x    w/cache        OSx 2.5        cc w/-O        3333    3333
  283.  * IBM-4341-II    -        VM/SP3        Waterloo C 1.2  3333    3333
  284.  * IRIS-2400T    68020-16.67Mhz    UNIX System V    cc        3105    3401
  285.  * Celerity C-1200 ?        UNIX 4.2BSD    cc        3485    3468
  286.  * SUN 3/75    68020-16.67Mhz    SUN 4.2 V3    cc        3333    3571
  287.  * IBM-4341    Model 12    UTS 5.0        ?        3685    3685
  288.  * SUN-3/160    68020-16.67Mhz  Sun 4.2 V3.0A   cc        3381    3764
  289.  * Sun 3/180    68020-16.67Mhz    Sun 4.2        cc        3333    3846
  290.  * IBM-4341    Model 12    UTS 5.0        ?        3910    3910 MN
  291.  * MC 5400    68020-16.67MHz    RTU V3.0    cc (V4.0)    3952    4054
  292.  * Intel 386/20    80386-12.5Mhz    PMON debugger    Intel C386v0.2    4149    4386
  293.  * NCR Tower32  68020-16.67Mhz  SYS 5.0 Rel 2.0 cc              3846    4545
  294.  * MC 5600/5700    68020-16.67MHz    RTU V3.0    cc (V4.0)    4504    4746 %
  295.  * Intel 386/20    80386-12.5Mhz    PMON debugger    Intel C386v0.2    4534    4794 i1
  296.  * Intel 386/20    80386-16Mhz    PMON debugger    Intel C386v0.2    5304    5607
  297.  * Gould PN9080    custom ECL    UTX-32 1.1C    cc        5369    5676
  298.  * Gould 1460-342 ECL proc      UTX/32 1.1/c    cc              5342    5677 G1
  299.  * VAX-784    -        Mach/4.3    cc        5882    5882 &4
  300.  * Intel 386/20    80386-16Mhz    PMON debugger    Intel C386v0.2    5801    6133 i1
  301.  * VAX 8600    -        UNIX 4.3bsd    cc        7024    7088
  302.  * VAX 8600    -        VMS        VAX-11 C 2.0    7142    7142
  303.  * Alliant FX/8 CE        Concentrix    cc -ce;exec -c     6952    7655 FX
  304.  * CCI POWER 6/32        COS(SV+4.2)    cc        7500    7800
  305.  * CCI POWER 6/32        POWER 6 UNIX/V    cc        8236    8498
  306.  * CCI POWER 6/32        4.2 Rel. 1.2b    cc        8963    9544
  307.  * Sperry (CCI Power 6)        4.2BSD        cc        9345   10000
  308.  * CRAY-X-MP/12       105Mhz    COS 1.14    Cray C         10204   10204
  309.  * IBM-3083    -        UTS 5.0 Rel 1    cc           16666   12500
  310.  * CRAY-1A        80Mhz    CTSS        Cray C 2.0     12100   13888
  311.  * IBM-3083    -        VM/CMS HPO 3.4    Waterloo C 1.2 13889   13889
  312.  * Amdahl 470 V/8         UTS/V 5.2       cc v1.23       15560   15560
  313.  * CRAY-X-MP/48       105Mhz    CTSS        Cray C 2.0     15625   17857
  314.  * Amdahl 580    -        UTS 5.0 Rel 1.2    cc v1.5        23076   23076
  315.  * Amdahl 5860             UTS/V 5.2       cc v1.23       28970   28970
  316.  *
  317.  * NOTE
  318.  *   *   Crystal changed from 'stock' to listed value.
  319.  *   +   This Macintosh was upgraded from 128K to 512K in such a way that
  320.  *       the new 384K of memory is not slowed down by video generator accesses.
  321.  *   %   Single processor; MC == MASSCOMP
  322.  *   NM  A version 7 C compiler written at New Mexico Tech.
  323.  *   @   vanilla Lattice compiler used with MicroPro standard library
  324.  *   S   Shorts used instead of ints
  325.  *   T     with Chris Torek's patches (whatever they are).
  326.  *   ~   For WICAT Systems: MB=MultiBus, PB=Proprietary Bus
  327.  *   LM  Large Memory Model. (Otherwise, all 80x8x results are small model)
  328.  *   MM  Medium Memory Model. (Otherwise, all 80x8x results are small model)
  329.  *   C1  Univation PC TURBO Co-processor; 9.54Mhz 8086, 640K RAM
  330.  *   C2  Seattle Telecom STD-286 board
  331.  *   C3  Definicon DSI-32 coprocessor
  332.  *   C?  Unknown co-processor board?
  333.  *   CT1 Convergent Technologies MegaFrame, 1 processor.
  334.  *   MN  Using Mike Newtons 'optimizer' (see net.sources).
  335.  *   G1  This Gould machine has 2 processors and was able to run 2 dhrystone
  336.  *       Benchmarks in parallel with no slowdown.
  337.  *   FH  FHC == Frank Hogg Labs (Hazelwood Uniquad 2 in an FHL box).
  338.  *   FX  The Alliant FX/8 is a system consisting of 1-8 CEs (computation
  339.  *     engines) and 1-12 IPs (interactive processors). Note N8 applies.
  340.  *   RT  This is one of the RT's that CMU has been using for awhile.  I'm
  341.  *     not sure that this is identical to the machine that IBM is selling
  342.  *     to the public.
  343.  *   i1  Normally, the 386/20 starter kit has a 16k direct mapped cache
  344.  *     which inserts 2 or 3 wait states on a write thru.  These results
  345.  *     were obtained by disabling the write-thru, or essentially turning
  346.  *     the cache into 0 wait state memory.
  347.  *   Nnn This machine has multiple processors, allowing "nn" copies of the
  348.  *     benchmark to run in the same time as 1 copy.
  349.  *   &nn This machine has "nn" processors, and the benchmark results were
  350.  *     obtained by having all "nn" processors working on 1 copy of dhrystone.
  351.  *     (Note, this is different than Nnn. Salesmen like this measure).
  352.  *   ?   I don't trust results marked with '?'.  These were sent to me with
  353.  *       either incomplete info, or with times that just don't make sense.
  354.  *     ?? means I think the performance is too poor, ?! means too good.
  355.  *       If anybody can confirm these figures, please respond.
  356.  *
  357.  *  ABBREVIATIONS
  358.  *    CCC    Concurrent Computer Corp. (was Perkin-Elmer)
  359.  *    MC    Masscomp
  360.  *
  361.  *--------------------------------RESULTS END----------------------------------
  362.  *
  363.  *    The following program contains statements of a high-level programming
  364.  *    language (C) in a distribution considered representative:
  365.  *
  366.  *    assignments            53%
  367.  *    control statements        32%
  368.  *    procedure, function calls    15%
  369.  *
  370.  *    100 statements are dynamically executed.  The program is balanced with
  371.  *    respect to the three aspects:
  372.  *        - statement type
  373.  *        - operand type (for simple data types)
  374.  *        - operand access
  375.  *            operand global, local, parameter, or constant.
  376.  *
  377.  *    The combination of these three aspects is balanced only approximately.
  378.  *
  379.  *    The program does not compute anything meaningfull, but it is
  380.  *    syntactically and semantically correct.
  381.  *
  382.  */
  383.  
  384. /* Accuracy of timings and human fatigue controlled by next two lines */
  385. #define LOOPS    50000        /* Use this for slow or 16 bit machines */
  386. /*#define LOOPS    500000        /* Use this for faster machines */
  387.  
  388. /* Compiler dependent options */
  389. #undef    NOENUM            /* Define if compiler has no enum's */
  390. #undef    NOSTRUCTASSIGN        /* Define if compiler can't assign structures */
  391.  
  392. /* define only one of the next two defines */
  393. /*#define TIMES            /* Use times(2) time function */
  394. #define TIME            /* Use time(2) time function */
  395.  
  396. /* define the granularity of your times(2) function (when used) */
  397. #define HZ    60        /* times(2) returns 1/60 second (most) */
  398. /*#define HZ    100        /* times(2) returns 1/100 second (WECo) */
  399.  
  400. /* for compatibility with goofed up version */
  401. /*#define GOOF            /* Define if you want the goofed up version */
  402.  
  403. #ifdef GOOF
  404. char    Version[] = "1.0";
  405. #else
  406. char    Version[] = "1.1";
  407. #endif
  408.  
  409. #ifdef    NOSTRUCTASSIGN
  410. #define    structassign(d, s)    memcpy(&(d), &(s), sizeof(d))
  411. #else
  412. #define    structassign(d, s)    d = s
  413. #endif
  414.  
  415. #ifdef    NOENUM
  416. #define    Ident1    1
  417. #define    Ident2    2
  418. #define    Ident3    3
  419. #define    Ident4    4
  420. #define    Ident5    5
  421. typedef int    Enumeration;
  422. #else
  423. typedef enum    {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;
  424. #endif
  425.  
  426. typedef int    OneToThirty;
  427. typedef int    OneToFifty;
  428. typedef char    CapitalLetter;
  429. typedef char    String30[31];
  430. typedef int    Array1Dim[51];
  431. typedef int    Array2Dim[51][51];
  432.  
  433. struct    Record
  434. {
  435.     struct Record        *PtrComp;
  436.     Enumeration        Discr;
  437.     Enumeration        EnumComp;
  438.     OneToFifty        IntComp;
  439.     String30        StringComp;
  440. };
  441.  
  442. typedef struct Record     RecordType;
  443. typedef RecordType *    RecordPtr;
  444. typedef int        boolean;
  445.  
  446. #define    NULL        0
  447. #define    TRUE        1
  448. #define    FALSE        0
  449.  
  450. #ifndef REG
  451. #define    REG
  452. #endif
  453.  
  454. extern Enumeration    Func1();
  455. extern boolean        Func2();
  456.  
  457. #ifdef TIMES
  458. #include <sys/types.h>
  459. #include <sys/times.h>
  460. #endif
  461.  
  462. main()
  463. {
  464.     Proc0();
  465.     exit(0);
  466. }
  467.  
  468. /*
  469.  * Package 1
  470.  */
  471. int        IntGlob;
  472. boolean        BoolGlob;
  473. char        Char1Glob;
  474. char        Char2Glob;
  475. Array1Dim    Array1Glob;
  476. Array2Dim    Array2Glob;
  477. RecordPtr    PtrGlb;
  478. RecordPtr    PtrGlbNext;
  479.  
  480. Proc0()
  481. {
  482.     OneToFifty        IntLoc1;
  483.     REG OneToFifty        IntLoc2;
  484.     OneToFifty        IntLoc3;
  485.     REG char        CharLoc;
  486.     REG char        CharIndex;
  487.     Enumeration         EnumLoc;
  488.     String30        String1Loc;
  489.     String30        String2Loc;
  490.     extern char        *malloc();
  491.  
  492. #ifdef TIME
  493.     long            time();
  494.     long            starttime;
  495.     long            benchtime;
  496.     long            nulltime;
  497.     register unsigned int    i;
  498.  
  499.     starttime = time( (long *) 0);
  500.     for (i = 0; i < LOOPS; ++i);
  501.     nulltime = time( (long *) 0) - starttime; /* Computes o'head of loop */
  502. #endif
  503. #ifdef TIMES
  504.     time_t            starttime;
  505.     time_t            benchtime;
  506.     time_t            nulltime;
  507.     struct tms        tms;
  508.     register unsigned int    i;
  509.  
  510.     times(&tms); starttime = tms.tms_utime;
  511.     for (i = 0; i < LOOPS; ++i);
  512.     times(&tms);
  513.     nulltime = tms.tms_utime - starttime; /* Computes overhead of looping */
  514. #endif
  515.  
  516.     PtrGlbNext = (RecordPtr) malloc(sizeof(RecordType));
  517.     PtrGlb = (RecordPtr) malloc(sizeof(RecordType));
  518.     PtrGlb->PtrComp = PtrGlbNext;
  519.     PtrGlb->Discr = Ident1;
  520.     PtrGlb->EnumComp = Ident3;
  521.     PtrGlb->IntComp = 40;
  522.     strcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING");
  523. #ifndef    GOOF
  524.     strcpy(String1Loc, "DHRYSTONE PROGRAM, 1'ST STRING");    /*GOOF*/
  525. #endif
  526.     Array2Glob[8][7] = 10;    /* Was missing in published program */
  527.  
  528. /*****************
  529. -- Start Timer --
  530. *****************/
  531. #ifdef TIME
  532.     starttime = time( (long *) 0);
  533. #endif
  534. #ifdef TIMES
  535.     times(&tms); starttime = tms.tms_utime;
  536. #endif
  537.     for (i = 0; i < LOOPS; ++i)
  538.     {
  539.  
  540.         Proc5();
  541.         Proc4();
  542.         IntLoc1 = 2;
  543.         IntLoc2 = 3;
  544.         strcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
  545.         EnumLoc = Ident2;
  546.         BoolGlob = ! Func2(String1Loc, String2Loc);
  547.         while (IntLoc1 < IntLoc2)
  548.         {
  549.             IntLoc3 = 5 * IntLoc1 - IntLoc2;
  550.             Proc7(IntLoc1, IntLoc2, &IntLoc3);
  551.             ++IntLoc1;
  552.         }
  553.         Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3);
  554.         Proc1(PtrGlb);
  555.         for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex)
  556.             if (EnumLoc == Func1(CharIndex, 'C'))
  557.                 Proc6(Ident1, &EnumLoc);
  558.         IntLoc3 = IntLoc2 * IntLoc1;
  559.         IntLoc2 = IntLoc3 / IntLoc1;
  560.         IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1;
  561.         Proc2(&IntLoc1);
  562.     }
  563.  
  564. /*****************
  565. -- Stop Timer --
  566. *****************/
  567.  
  568. #ifdef TIME
  569.     benchtime = time( (long *) 0) - starttime - nulltime;
  570.     printf("Dhrystone(%s) time for %ld passes = %ld\n",
  571.         Version,
  572.         (long) LOOPS, benchtime);
  573.     printf("This machine benchmarks at %ld dhrystones/second\n",
  574.         ((long) LOOPS) / benchtime);
  575. #endif
  576. #ifdef TIMES
  577.     times(&tms);
  578.     benchtime = tms.tms_utime - starttime - nulltime;
  579.     printf("Dhrystone(%s) time for %ld passes = %ld\n",
  580.         Version,
  581.         (long) LOOPS, benchtime/HZ);
  582.     printf("This machine benchmarks at %ld dhrystones/second\n",
  583.         ((long) LOOPS) * HZ / benchtime);
  584. #endif
  585.  
  586. }
  587.  
  588. Proc1(PtrParIn)
  589. REG RecordPtr    PtrParIn;
  590. {
  591. #define    NextRecord    (*(PtrParIn->PtrComp))
  592.  
  593.     structassign(NextRecord, *PtrGlb);
  594.     PtrParIn->IntComp = 5;
  595.     NextRecord.IntComp = PtrParIn->IntComp;
  596.     NextRecord.PtrComp = PtrParIn->PtrComp;
  597.     Proc3(NextRecord.PtrComp);
  598.     if (NextRecord.Discr == Ident1)
  599.     {
  600.         NextRecord.IntComp = 6;
  601.         Proc6(PtrParIn->EnumComp, &NextRecord.EnumComp);
  602.         NextRecord.PtrComp = PtrGlb->PtrComp;
  603.         Proc7(NextRecord.IntComp, 10, &NextRecord.IntComp);
  604.     }
  605.     else
  606.         structassign(*PtrParIn, NextRecord);
  607.  
  608. #undef    NextRecord
  609. }
  610.  
  611. Proc2(IntParIO)
  612. OneToFifty    *IntParIO;
  613. {
  614.     REG OneToFifty        IntLoc;
  615.     REG Enumeration        EnumLoc;
  616.  
  617.     IntLoc = *IntParIO + 10;
  618.     for(;;)
  619.     {
  620.         if (Char1Glob == 'A')
  621.         {
  622.             --IntLoc;
  623.             *IntParIO = IntLoc - IntGlob;
  624.             EnumLoc = Ident1;
  625.         }
  626.         if (EnumLoc == Ident1)
  627.             break;
  628.     }
  629. }
  630.  
  631. Proc3(PtrParOut)
  632. RecordPtr    *PtrParOut;
  633. {
  634.     if (PtrGlb != NULL)
  635.         *PtrParOut = PtrGlb->PtrComp;
  636.     else
  637.         IntGlob = 100;
  638.     Proc7(10, IntGlob, &PtrGlb->IntComp);
  639. }
  640.  
  641. Proc4()
  642. {
  643.     REG boolean    BoolLoc;
  644.  
  645.     BoolLoc = Char1Glob == 'A';
  646.     BoolLoc |= BoolGlob;
  647.     Char2Glob = 'B';
  648. }
  649.  
  650. Proc5()
  651. {
  652.     Char1Glob = 'A';
  653.     BoolGlob = FALSE;
  654. }
  655.  
  656. extern boolean Func3();
  657.  
  658. Proc6(EnumParIn, EnumParOut)
  659. REG Enumeration    EnumParIn;
  660. REG Enumeration    *EnumParOut;
  661. {
  662.     *EnumParOut = EnumParIn;
  663.     if (! Func3(EnumParIn) )
  664.         *EnumParOut = Ident4;
  665.     switch (EnumParIn)
  666.     {
  667.     case Ident1:    *EnumParOut = Ident1; break;
  668.     case Ident2:    if (IntGlob > 100) *EnumParOut = Ident1;
  669.             else *EnumParOut = Ident4;
  670.             break;
  671.     case Ident3:    *EnumParOut = Ident2; break;
  672.     case Ident4:    break;
  673.     case Ident5:    *EnumParOut = Ident3;
  674.     }
  675. }
  676.  
  677. Proc7(IntParI1, IntParI2, IntParOut)
  678. OneToFifty    IntParI1;
  679. OneToFifty    IntParI2;
  680. OneToFifty    *IntParOut;
  681. {
  682.     REG OneToFifty    IntLoc;
  683.  
  684.     IntLoc = IntParI1 + 2;
  685.     *IntParOut = IntParI2 + IntLoc;
  686. }
  687.  
  688. Proc8(Array1Par, Array2Par, IntParI1, IntParI2)
  689. Array1Dim    Array1Par;
  690. Array2Dim    Array2Par;
  691. OneToFifty    IntParI1;
  692. OneToFifty    IntParI2;
  693. {
  694.     REG OneToFifty    IntLoc;
  695.     REG OneToFifty    IntIndex;
  696.  
  697.     IntLoc = IntParI1 + 5;
  698.     Array1Par[IntLoc] = IntParI2;
  699.     Array1Par[IntLoc+1] = Array1Par[IntLoc];
  700.     Array1Par[IntLoc+30] = IntLoc;
  701.     for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex)
  702.         Array2Par[IntLoc][IntIndex] = IntLoc;
  703.     ++Array2Par[IntLoc][IntLoc-1];
  704.     Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc];
  705.     IntGlob = 5;
  706. }
  707.  
  708. Enumeration Func1(CharPar1, CharPar2)
  709. CapitalLetter    CharPar1;
  710. CapitalLetter    CharPar2;
  711. {
  712.     REG CapitalLetter    CharLoc1;
  713.     REG CapitalLetter    CharLoc2;
  714.  
  715.     CharLoc1 = CharPar1;
  716.     CharLoc2 = CharLoc1;
  717.     if (CharLoc2 != CharPar2)
  718.         return (Ident1);
  719.     else
  720.         return (Ident2);
  721. }
  722.  
  723. boolean Func2(StrParI1, StrParI2)
  724. String30    StrParI1;
  725. String30    StrParI2;
  726. {
  727.     REG OneToThirty        IntLoc;
  728.     REG CapitalLetter    CharLoc;
  729.  
  730.     IntLoc = 1;
  731.     while (IntLoc <= 1)
  732.         if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1)
  733.         {
  734.             CharLoc = 'A';
  735.             ++IntLoc;
  736.         }
  737.     if (CharLoc >= 'W' && CharLoc <= 'Z')
  738.         IntLoc = 7;
  739.     if (CharLoc == 'X')
  740.         return(TRUE);
  741.     else
  742.     {
  743.         if (strcmp(StrParI1, StrParI2) > 0)
  744.         {
  745.             IntLoc += 7;
  746.             return (TRUE);
  747.         }
  748.         else
  749.             return (FALSE);
  750.     }
  751. }
  752.  
  753. boolean Func3(EnumParIn)
  754. REG Enumeration    EnumParIn;
  755. {
  756.     REG Enumeration    EnumLoc;
  757.  
  758.     EnumLoc = EnumParIn;
  759.     if (EnumLoc == Ident3) return (TRUE);
  760.     return (FALSE);
  761. }
  762.  
  763. #ifdef    NOSTRUCTASSIGN
  764. memcpy(d, s, l)
  765. register char    *d;
  766. register char    *s;
  767. register int    l;
  768. {
  769.     while (l--) *d++ = *s++;
  770. }
  771. #endif
  772.